package com.open.capacity.points.controller;

import com.open.capacity.common.exception.controller.ControllerException;
import com.open.capacity.common.web.Result;
import com.open.capacity.log.annotation.LogAnnotation;
import com.open.capacity.points.service.PointsRuleTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("pointsRuleType")
@Api(tags = "POINTS-RULE-TYPE API")
public class PointsRuleTypeController {
    @Resource
    private PointsRuleTypeService pointsRuleTypeService;

    @GetMapping("/get")
    @ApiOperation(value = "返回积分规则类型")
    @LogAnnotation(module = "points-center")
    public Result getPointsRule() throws ControllerException {
        return Result.succeed(pointsRuleTypeService.list(), "");
    }

}
